<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{stockTransactionBean.id}"/>
		<f:event type="preRenderView" listener="#{stockTransactionBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Stock Transaction"/>

	<ui:define name="header">
		Stock Transaction
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty stockTransactionBean.id}">
				Edit existing Stock Transaction
			</c:when>
			<c:otherwise>
				Create a new Stock Transaction
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="stockTransactionBeanStockTransactionCreatedOn" value="Created On:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionCreatedOn" maxLength="10" value="#{stockTransactionBean.stockTransaction.createdOn}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="stockTransactionBeanStockTransactionCreatedOn" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionDirection" value="Direction:"/>
				<h:panelGroup>
					<h:selectOneMenu id="stockTransactionBeanStockTransactionDirection" value="#{stockTransactionBean.stockTransaction.direction}">
						<f:selectItem/>
						<f:selectItem itemLabel="Yes" itemValue="true"/>
						<f:selectItem itemLabel="No" itemValue="false"/>
					</h:selectOneMenu>
					<h:message for="stockTransactionBeanStockTransactionDirection" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionIsDeleted" value="Is Deleted:"/>
				<h:panelGroup>
					<h:selectOneMenu id="stockTransactionBeanStockTransactionIsDeleted" value="#{stockTransactionBean.stockTransaction.isDeleted}">
						<f:selectItem/>
						<f:selectItem itemLabel="Yes" itemValue="true"/>
						<f:selectItem itemLabel="No" itemValue="false"/>
					</h:selectOneMenu>
					<h:message for="stockTransactionBeanStockTransactionIsDeleted" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionModifiedOn" value="Modified On:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionModifiedOn" maxLength="10" value="#{stockTransactionBean.stockTransaction.modifiedOn}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="stockTransactionBeanStockTransactionModifiedOn" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionPricePerUnit" value="Price Per Unit:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionPricePerUnit" value="#{stockTransactionBean.stockTransaction.pricePerUnit}"/>
					<h:message for="stockTransactionBeanStockTransactionPricePerUnit" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionPriceTotal" value="Price Total:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionPriceTotal" value="#{stockTransactionBean.stockTransaction.priceTotal}"/>
					<h:message for="stockTransactionBeanStockTransactionPriceTotal" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionQuantity" value="Quantity:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionQuantity" value="#{stockTransactionBean.stockTransaction.quantity}"/>
					<h:message for="stockTransactionBeanStockTransactionQuantity" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionTableId" value="Table Id:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionTableId" required="true" value="#{stockTransactionBean.stockTransaction.tableId}"/>
					<h:message for="stockTransactionBeanStockTransactionTableId" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="stockTransactionBeanStockTransactionTransactionDate" value="Transaction Date:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionTransactionDate" value="#{stockTransactionBean.stockTransaction.transactionDate}"/>
					<h:message for="stockTransactionBeanStockTransactionTransactionDate" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionCustomerId" value="Customer Id:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionCustomerId" value="#{stockTransactionBean.stockTransaction.customerId}"/>
					<h:message for="stockTransactionBeanStockTransactionCustomerId" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionStockId" value="Stock Id:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionStockId" value="#{stockTransactionBean.stockTransaction.stockId}"/>
					<h:message for="stockTransactionBeanStockTransactionStockId" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionCreatedBy" value="Created By:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionCreatedBy" value="#{stockTransactionBean.stockTransaction.createdBy}"/>
					<h:message for="stockTransactionBeanStockTransactionCreatedBy" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionModifiedBy" value="Modified By:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionModifiedBy" value="#{stockTransactionBean.stockTransaction.modifiedBy}"/>
					<h:message for="stockTransactionBeanStockTransactionModifiedBy" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="stockTransactionBeanStockTransactionSoldBy" value="Sold By:"/>
				<h:panelGroup>
					<h:inputText id="stockTransactionBeanStockTransactionSoldBy" value="#{stockTransactionBean.stockTransaction.soldBy}"/>
					<h:message for="stockTransactionBeanStockTransactionSoldBy" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{stockTransactionBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty stockTransactionBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{stockTransactionBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{stockTransactionBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>